package com.loong.order.controller;

import com.loong.common.http.OKHttpUtil;
import com.loong.common.rabbitmq.dto.*;
import com.loong.common.rabbitmq.dto.base.CommonEventDto;
import com.loong.order.mq.OrderReport;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description: 测试
 * @Author: hzp
 * @Date: 2020-12-29 15:02
 */
@RestController
@RequestMapping("/manage/order/topicMq")
public class TopicMqControllerTest{

    @Resource
    private OrderReport orderReport;

    @PostMapping("testTopicMq")
    public void test(){
        OrderDTO build = OrderDTO.builder().orderBase(OrderBase.builder().orderNumber("123456").build()).build();
        CommonEventDto<OrderDTO> shopDTORepositoryEventDto = CommonEventDto.buildWithCreate(build);
        orderReport.report(shopDTORepositoryEventDto);
    }
}
